package com.lsp.server.product.controller;

import com.lsp.server.common.Apiresponse;
import com.lsp.server.product.service.AttrValusService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName AttrValus
 * @Description 商品属性值
 * @Author Mr Hao
 * @Date 2021/11/24 10:05
 */
@RestController
@RequestMapping("/values")
public class AttrValuesController {

    @Autowired
    private AttrValusService valusService;

    /**
     * 根据id查询数据
     * @param id
     * @return
     */
    @PostMapping("/queryValuesById")
    public Apiresponse getAll(Integer id){
        if (null == id){
            return Apiresponse.Error(400,"参数异常");
        }
        return Apiresponse.success(valusService.getAll(id));
    }
}
